<?php

class Comment_Model extends CI_Model{
	
	/*
	* Add comment to db
	*/ 
	function addComment($data){
		
		$this->db->insert('comment', $data);
	}
	
	/*
	 * get all comments of an idea
	 */
	function getAllCommentsOf($ideaId){
		$comments = $this->db->get_where('comment', array('idea_idea_id' => $ideaId))->result();
		
		return $comments;
	}
	
}
    
?>